#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n, m;
ll b[200005];
ll a[200005];
int main() {
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
        scanf("%lld", &b[i]);
        a[b[i]]++;
        // cout << a[b[i]] << " " << b[i] << endl;
    }
    sort(b + 1, b + n + 1);
    int m = unique(b + 1, b + n + 1) - b - 1;
    // cout << m << endl;
    for (int i = 2, j = 1; i <= m; i++) {
        ll tmp = a[b[i]];
        while (tmp > 0 && j < i) {
            if (tmp >= a[b[j]]) {
                tmp -= a[b[j]];
                a[b[j]] = 0;
                j++;
            }
            else {
                a[b[j]] -= tmp;
                tmp = 0;
            }
        }
    }
    ll ans = 0;
    for (int i = 1; i <= m; i++) {
        ans += a[b[i]];
        // cout << b[i] << endl;
    }
    printf("%lld\n", ans);
    return 0;
}